package Template;

import org.w3c.dom.ls.LSInput;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * 高精度减法
 */
public class subtractBig {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String A = bf.readLine();
        String B = bf.readLine();
        List<Integer> aList = new ArrayList<>();
        List<Integer> bList = new ArrayList<>();
        for (int i = A.length() - 1; i >= 0; i--) {
            aList.add(A.charAt(i) - '0');
        }
        for (int i = B.length() - 1; i >= 0; i--) {
            bList.add(B.charAt(i) - '0');
        }
        List<Integer> res = subtract(aList, bList);
        for (int i = res.size() - 1; i >= 0; i--) {
            System.out.print(res.get(i));
        }
        bf.close();
    }

    private static List<Integer> subtract(List<Integer> A, List<Integer> B) {
        if (!compare(A, B)) {
            System.out.print("-");
            return subtract(B, A);
        }
        List<Integer> C = new ArrayList<>();
        int t = 0;
        for (int i = 0; i < A.size(); i++) {
            t = A.get(i) - t;
            if (i < B.size()) {
                t -= B.get(i);
            }
            C.add((t + 10) % 10);
            if (t < 0) {
                t = 1;
            } else {
                t = 0;
            }
        }
        while (C.size() > 1 && C.get(C.size() - 1) == 0) {
            C.remove(C.size() - 1);
        }
        return C;
    }

    //判断大小
    private static boolean compare(List<Integer> A, List<Integer> B) {
        if (A.size() != B.size()) {
            return A.size() > B.size();
        }
        for (int i = 0; i < A.size(); i++) {
            if (A.get(i) == B.get(i)) {
                continue;
            }
            return A.get(i) > B.get(i);
        }
        return true;
    }


}
